#ifndef __Prop_H_
#define __Prop_H_
#include <MyString.h>


enum Effect
{
    Fronzen,
    SuckBlood,
    Reflect,
    DoubleAttack

};

enum PropType
{
    WEAPON,
    DEFENCE,
    MEDICAMENT
};

struct prop
{
    enum PropType type;      //道具类型
    void *ptr;          //指向道具对象的指针
};

typedef struct prop Prop;
Prop *CreateProp(enum PropType type,void* ptr);
void FreeProp(void *p,void (*clearPtr)(void*));

struct weapon 
{
    MyStr name;
    int attack;
    enum Effect effect;
};
typedef struct weapon Weapon;
Weapon* CreateWeapon(const char *name,int attack,enum Effect effect);
void FreeWeapon(void* ptr);
MyStr WeaponToString(Weapon *w);

struct defence 
{
    MyStr name;
    int defence;
    enum Effect effect;
};
typedef struct defence Defence;
Defence* CreateDefence(const char *name,int defence,enum Effect effect);
void FreeDefence(void* ptr);
MyStr DefenceToString(Defence *d);

struct medicament
{
    MyStr name;
    int HP;
    enum Effect effect;
};
typedef struct medicament Medicament;
Medicament* CreateMedicament(const char *name,int HP,enum Effect effect);
void FreeMedicament(void* ptr);
MyStr MedicamentToString(Medicament *m);

#endif